<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'质保金'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "137">
        <div class="analyItem" v-for="(item,index) in zbMoney" :key="index">
            <p class="analyItemTit tx-center" :data-title ="item.proname">{{item.proname | slice(0,4)}}</p>
            <div class="analyItemCon">
                <p class="col-md-4">
                    <span class="cLightGray pr8">任务单号</span>
                    <span>{{item.orderNo}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">合同额</span>
                    <span>{{item.contractFee}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">质保额</span>
                    <span>{{item.zbjExpire}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">超期</span>
                    <span>{{item.warrantyPeriod}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">超期未收</span>
                    <span>{{item.zbjExpire-item.zbjNotExpire}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8"></span>
                    <span></span>
                </p>
            </div>
        </div>
    </div>
    <div class="layerRtb-footer">
        <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
          <div class="analyItemCon">
              <p class="col-md-6">
                    <span class="cLightGray pr8">可结算</span>
                    <span>{{resultKJie}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">待收尾款</span>
                    <span>{{resultDshou}}</span>
                </p>
            </div>
        </div>
    </div>
</div>
</template>
<script>
import {
    mapGetters
} from 'vuex'
import {
    getPmUserinfoWarrantyGoldbyUid
} from '../../Resources/Api'
export default {
    data () {
        return {
            resultList: [],
            zbMoney: []
        }
    },
    created () {
        this.getPmUserinfoWarrantyGoldbyUid()
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    methods: {
        getPmUserinfoWarrantyGoldbyUid () {
            let _this = this
            _this.zbMoney = {}
            getPmUserinfoWarrantyGoldbyUid({
                uid: this.leftInfo.uid
            }).then(result => {
                if (result.data.Body !== 100) {
                    _this.zbMoney = result.data.Body
                } else {
                    _this.zbMoney = []
                }
            }).catch(err => {
                console.log(err)
            })
        }
    },
    watch: {
        leftInfo () {
            this.getPmUserinfoWarrantyGoldbyUid()
        }
    }
}
</script>
